<!DOCTYPE html>
<html>

<head>
    <title></title>



    <?php
      include_once('head.php');
   ?>
</head>
<body>

    <!--
      =============================================

       PAGE survey: pagina finale,
            per inserire commenti e votare la demo

      =============================================
     -->
  


<div data-role="page" id="page-survey" data-theme="f">
      
      
     <script>
      $( "#page-survey" ).live( "pageinit", function( event ) { 
        $('#page-survey a.backbutton').prepend('<div style="position: absolute; width: 16px; height: 17px; background: rgb(150, 174, 204); position: absolute; -webkit-transform: rotate(45deg); top: 3px; left: -8px; border: 1px solid rgba(0,0,0, 0.4); -webkit-box-shadow: 0 1px 0 rgba(255,255,255, 0.25), inset 0 1px 1px rgba(0,0,0, 0.2)"></div>');
      });
      
     
 /*
  
   //bind an event handler to the submit event for your login form
  $('#form_id').live('submit', function (e) {

    //cache the form element for use in this function
    var $this = $(this);

    //prevent the default submission of the form
    e.preventDefault();

    //run an AJAX post request to your server-side script, $this.serialize() is the data from your form being added to the request
    $.post($this.attr('action'), $this.serialize(), function (responseData) {

        //in here you can analyze the output from your server-side script (responseData) and validate the user's login without leaving the page
    });
  });
   
  */


      $('input[name=radio_y_n]').live('change',function() {

          $('#block-if-yes input:checkbox').attr('checked', false).checkboxradio("refresh");
          $('#block-if-not input:checkbox').attr('checked', false).checkboxradio("refresh");


          $('#block-if-yes').hide();
          $('#block-if-not').hide();

         if ($(this).val() == 'no')
             $('#block-if-not').show();
          else if ($(this).val() == 'yes')
             $('#block-if-yes').show();

      });



       $('input#submit-survey').live('click', function() {
          if ($('input:checkbox').is(':checked'))
            $('form#form-survey').submit();
          else
            alert('Specifica almeno un opzione');

       });
 
 
      
     </script>


    <div id="fb-root"></div>

    <script>(function(d, s, id) {
        var js, fjs = d.getElementsByTagName(s)[0];
        if (d.getElementById(id)) return;
        js = d.createElement(s); js.id = id;
        js.src = "//connect.facebook.net/it_IT/all.js#xfbml=1";
        fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));
    </script>



      
     <!-- /header -->
    <div data-role="header" data-theme="f">
      <!--<a href="" data-rel="back" class="backbutton" >Back</a>-->
      <h1 class="ui-title" tabindex="0" role="heading" aria-level="1">Feedback</h1>
    </div>
    

    <!-- /content -->
    <div data-role="content" >  
      
     <p>
       <h3>Grazie per aver provato la demo!</h3>
     </p>

    

  <!--
     <p>
     <h2>Dai un voto:</h2>
     </p>
    
     <div class="rateit" id="rateit9"></div>
   -->
     
     
     <!--
     <div>
        <button onclick="alert($('#rateit9').rateit('value'))">Get value</button>    
     </div>
     -->
     
    
        <form action="script_save_survey.php" method="post" data-ajax="false" name="form-survey" id="form-survey">
          
          <input type="hidden" name="rate" />
          
          <div data-role="fieldcontain" style="border-bottom: none;">
          <fieldset id="y_n" data-role="controlgroup" data-type="horizontal">
            <legend>Faresti un regalo con Giftshake</legend>
              <input type="radio" name="radio_y_n" id="yes_opt" value="yes" checked="checked" />
              <label for="yes_opt">Penso di Si</label>
              <input type="radio" name="radio_y_n" id="no_opt"  value="no"  />
              <label for="no_opt">Penso di No</label>
          </fieldset>
          </div>


            <!-- If YES -->
            <div id="block-if-yes" >
            <fieldset data-role="controlgroup">
                <legend>Perchè:</legend>
                <input type="checkbox" name="survey_yes_options[]" id="checkbox-y-2a" data-mini="true" value="trovo_sia_utile">
                <label for="checkbox-y-2a">Trovo che sia utile</label>
                <input type="checkbox" name="survey_yes_options[]" id="checkbox-y-2b" data-mini="true" value="interessante_ricevere_consigli">
                <label for="checkbox-y-2b">E' interessante ricevere dei consigli</label>
                <input type="checkbox" name="survey_yes_options[]" id="checkbox-y-2c" data-mini="true" value="semplifica_regalo_singolo">
                <label for="checkbox-y-2c">Mi semplifica la vita quando faccio un regalo individuale</label>
                <input type="checkbox" name="survey_yes_options[]" id="checkbox-y-2d" data-mini="true" value="semplifica_regalo_gruppo">
                <label for="checkbox-y-2d">Mi semplifica la vita quando faccio un regalo in gruppo</label>
            </fieldset>
            </div>

            <!-- If NO -->
            <div id="block-if-not" style="display: none" >
            <fieldset data-role="controlgroup">
                <legend>Perchè:</legend>
                <input type="checkbox" name="survey_no_options[]" id="checkbox-n-2a" data-mini="true" value="trovo_non_sia_utile">
                <label for="checkbox-n-2a">Trovo che non sia utile</label>
                <input type="checkbox" name="survey_no_options[]" id="checkbox-n-2b" data-mini="true" value="so_cosa_acquistare">
                <label for="checkbox-n-2b">Di solito so cosa acquistare</label>
                <input type="checkbox" name="survey_no_options[]" id="checkbox-n-2c" data-mini="true" value="non_semplifica_regalo_singolo">
                <label for="checkbox-n-2c">Non mi semplifica la vita quando faccio un regalo individuale</label>
                <input type="checkbox" name="survey_no_options[]" id="checkbox-n-2d" data-mini="true" value="non_semplifica_regalo_gruppo">
                <label for="checkbox-n-2d">Non mi semplifica la vita quando faccio un regalo in gruppo</label>
            </fieldset>
            </div>
          
          
          <fieldset>
            <div data-role="fieldcontain">
               <label for="comment-box">Commenti:</label>
               <textarea cols="40" rows="8" name="comment-box" id="comment-box"></textarea>
            </div>
            
            <input type="button" name="submit-survey" id="submit-survey" value="invia" data-theme="b"/>

            </fieldset>
        </form>

        <br/>
        <hr/>
        <br/>

        <div class="fb-like" data-href="https://www.facebook.com/pages/Giftshake/358940910888185?ref=hl"
        data-send="false" data-layout="button_count" data-width="150" data-show-faces="false"></div>

       
    </div>
    
    <div style="text-align: center"  data-role="footer" data-theme="c" >
      <ul style="list-style: none; padding: 0">
        <li>
         <a data-inline="true" href="" 
             style ="text-decoration: none; font-size: 13px; color: #999999 ">Giftshake © 2013</a>       
         
         <a data-inline="true" href="" 
             style ="text-decoration: none; padding-left: 20px; font-size: 13px; color: #999999" >Guida
         </a>
        </li>
     </ul>
   </div> <!-- end footer -->
    
    </div>  <!-- end page -->
</body>
</html>